<?php

/**
 * SolicitudVersion form base class.
 *
 * @method SolicitudVersion getObject() Returns the current form's model object
 *
 * @package    BecArTe
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSolicitudVersionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'fecha'       => new sfWidgetFormDate(),
      'estado'      => new sfWidgetFormChoice(array('choices' => array('En Presentación' => 'En Presentación', 'Vencida' => 'Vencida', 'En Evaluación' => 'En Evaluación', 'Aprobada' => 'Aprobada', 'Rechazada' => 'Rechazada'))),
      'observacion' => new sfWidgetFormTextarea(),
      'alumno_id'   => new sfWidgetFormInputText(),
      'beca_id'     => new sfWidgetFormInputText(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
      'created_by'  => new sfWidgetFormInputText(),
      'updated_by'  => new sfWidgetFormInputText(),
      'version'     => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'fecha'       => new sfValidatorDate(),
      'estado'      => new sfValidatorChoice(array('choices' => array(0 => 'En Presentación', 1 => 'Vencida', 2 => 'En Evaluación', 3 => 'Aprobada', 4 => 'Rechazada'), 'required' => false)),
      'observacion' => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'alumno_id'   => new sfValidatorInteger(),
      'beca_id'     => new sfValidatorInteger(),
      'created_at'  => new sfValidatorDateTime(),
      'updated_at'  => new sfValidatorDateTime(),
      'created_by'  => new sfValidatorInteger(array('required' => false)),
      'updated_by'  => new sfValidatorInteger(array('required' => false)),
      'version'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('version')), 'empty_value' => $this->getObject()->get('version'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('solicitud_version[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SolicitudVersion';
  }

}
